package com.ruoyi.community.mapper;

import com.ruoyi.community.domain.BbsArticleComment;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface BbsArticleCommentMapper {
    int deleteByPrimaryKey(Long commentid);

    int insert(BbsArticleComment record);

    int insertSelective(BbsArticleComment record);

    BbsArticleComment selectByPrimaryKey(Long commentid);

    int updateByPrimaryKeySelective(BbsArticleComment record);

    int updateByPrimaryKey(BbsArticleComment record);

    List<BbsArticleComment> findByParentIdNull(@Param("CommunityId")Integer CommunityId,@Param("ArticleId")Long ArticleId);

    List<BbsArticleComment> findByParentIdNotNull(@Param("CommunityId")Integer CommunityId,@Param("ArticleId")Long ArticleId,@Param("ParentId")Long ParentId);

    List<BbsArticleComment> findByBlogIdAndReplayId(@Param("CommunityId")Integer CommunityId,@Param("ArticleId")Long ArticleId,@Param("ParentId")Long ParentId);

    List<BbsArticleComment> findReplyComments(@Param("parentid")Long parentid);

    List<BbsArticleComment> findAllReplyComments(@Param("parentid")Long parentid);

    List<BbsArticleComment> findParentComments(@Param("communityid")Integer communityid,@Param("articleid")Long articleid);

    int countCommentByArticleId(@Param("communityid")Integer communityid,@Param("articleid")Long articleid);

    int countChildComments(@Param("parentid")Long parentid);

    int delete(Long commentid);
}